﻿namespace KingerRobot.MexicoSailunMDC.Spi;
/// <summary>
/// 入库全景扫描服务
/// </summary>
public interface IWarehousingBeforeService
{
    /// <summary>
    /// 入库前任务创建(定时)
    /// </summary>
    long CreateTask(long locId);
    /// <summary>
    /// 入库前任务创建(扫码处)
    /// </summary>
    /// <param name="scannerLocId"></param>
    /// <param name="productCode"></param>
    /// <returns></returns>
    long CreateTaskV2(long scannerLocId, string productCode);

    /// <summary>
    /// 入库前 配对入库生成任务
    /// </summary>
    /// <par`am name="scannerLocId">扫码头id</param>
    /// <param name="productCodeA">条码a 远离到码头的胎胚</param>
    /// <param name="productCodeB">条码b 靠近扫码头的胎胚</param>
    /// <returns></returns>
    long CreatePairTask(long scannerLocId, string productCodeA, string productCodeB);
    /// <summary>
    /// 添加扫码记录
    /// </summary>
    /// <param name="scannerLocId"></param>
    /// <param name="productCode"></param>
    /// <returns></returns>
    int CreatePairScanner(long scannerLocId, string productCode);


    ///// <summary>
    ///// 入库前 配对入库生成任务
    ///// </summary>
    ///// <param name="scannerLocId">扫码头id</param>
    ///// <param name="productCodeA">条码</param>
    ///// <param name="productCodeB">条码</param>
    ///// <param name="pariTargetLoc">上一条配对胎的目的地 如果物料匹配B目的地直接用此位置</param>
    ///// <param name="isAbnormal">是否生成异常任务  true:生成异常</param>
    ///// <param name="pairStatus">当前任务配对状态 0未配对 1配对中  2下发完成  如果在线体上两条胎完成配对 则B位置任务的配对状态为1 待B位置任务下发后 修改为2</param>
    ///// <returns></returns>
    //long CreatePairTask(long scannerLocId, string productCodeA, string productCodeB, long pariTargetLoc, bool isAbnormal, int pairStatus);

    /// <summary>
    /// 异常入库
    /// </summary>
    /// <returns></returns>
    public long CreateAbnormalTask();


    /// <summary>
    /// 入库前任务执行
    /// </summary>
    /// <param name="taskNo">任务编号</param>
    int ExecuteTask(int taskNo, long locId);


    /// <summary>
    /// 入库前任务完成[不要单独调用 它实在入库创建任务时调用]
    /// </summary>
    /// <param name="taskNo">任务编号</param>
    /// <param name="locId">最终库位</param>
    int FinishTaskCmd(int taskNo, long locId);




}
public class SyncBean
{
    public int Code { get; set; }
    public string Msg { get; set; }
}
public class SyncParm
{

    public DateTime StartTime { get; set; }
    public DateTime EndTime { get; set; }
}
